<div class="page-title clearfix">
  <div class="title">Count管理</div>
  <button nz-button class="fr btn-green" [routerLink]="routerLinks.count.add" title="添加"><i
    class="anticon anticon-plus"></i>
    添加
  </button>
</div>

<div class="panel panel-body">
  <!--搜索 start-->
  <form nz-form (submit)="queryCountList(1)">
    <div class="search-group">
      <span class="search-title">count名：</span>
      <div class="search-main">
        <input nz-input name="name"
               [(ngModel)]="searchParams.name"
               placeholder="请输入">
      </div>
    </div>
    <div class="inline-block">
      <button nz-button class="ml-20 mr" [nzType]="'primary'" title="搜索" type="submit">
        <i class="anticon anticon-search"></i><span>搜索</span>
      </button>
      <button nz-button class="mr" title="重置" type="reset" (click)="resetSearch()">
        <i class="anticon anticon-sync"></i><span>重置</span>
      </button>
    </div>
  </form>
  <!--搜索 end-->
</div>
<div class="panel">
  <nz-table #nzTable
            [nzData]="countList.voList"
            [nzLoading]="_loading"
            [nzFrontPagination]="false"
            [nzShowTotal]="totalRow"
            [nzPageSize]="countList.pageSize"
            [nzTotal]="countList.totalRow"
            [nzPageIndex]="countList.curPage"
            (nzPageIndexChange)="queryCountList($event)">
    <thead nz-thead>
    <ng-template #totalRow>共 {{countList.totalRow}} 条数据</ng-template>
    <tr>
      <th nz-th class="text-center" nzWidth=""><span>序号</span></th><!--序号-->
      <th nz-th class="text-center" nzWidth=""><span>金兰宝产</span></th><!--金兰宝产生总数量-->
      <th nz-th class="text-center" nzWidth=""><span>金兰宝消</span></th><!--金兰宝消耗的总数量-->
      <th nz-th class="text-center" nzWidth=""><span>矿石产生</span></th><!--矿石产生的总数量-->
      <th nz-th class="text-center" nzWidth=""><span>矿石消耗</span></th><!--矿石消耗的总数量-->
      <th nz-th class="text-center" nzWidth=""><span>状态</span></th><!--状态-->
      <th nz-th class="text-center" nzWidth=""><span>操作</span></th><!--操作-->
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
      <tr nz-tbody-tr>
        <td nz-td class="text-center">{{i+1}}</td>
        <td nz-td class="text-center">{{data.totalJlb}}</td>
        <td nz-td class="text-center">{{data.costJlb}}</td>
        <td nz-td class="text-center">{{data.totalOre}}</td>
        <td nz-td class="text-center">{{data.costOre}}</td>
        <td nz-td class="text-center">
          <nz-switch class="thc" [ngModel]="data.state === states.enable" [ngModelOptions]="{standalone: true}"
                     nzCheckedChildren="是" nzUnCheckedChildren="否"
                     (ngModelChange)="modifyCountState(data.code, $event)">
          </nz-switch>
        </td>
        <td nz-td class="text-center">
          <button nz-button class="btn-blue-o mr" [routerLink]="[routerLinks.count.modify,data.code]"
                  title="修改">
            <i class="anticon anticon-edit"></i></button>
          <button nz-button class="btn-success-o" [routerLink]="[routerLinks.count.detail,data.code]"
                  title="查看">
            <i class="anticon anticon-eye-o"></i></button>
        </td>
      </tr>
    </ng-template>
    </tbody>
  </nz-table>
</div>
